// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   Md5.java

package com.dtwave.wechat.service.provider.common.utils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Md5
{

	public Md5()
	{
	}

	public static final String getPwd(String pwd)
	{
		char hexDigits[] = {
			'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 
			'a', 'b', 'c', 'd', 'e', 'f'
		};
		byte strTemp[] = pwd.getBytes();
		char str[];
		try
		{
			MessageDigest mdTemp = MessageDigest.getInstance("MD5");
			mdTemp.update(strTemp);
			byte md[] = mdTemp.digest();
			int j = md.length;
			str = new char[j * 2];
			int k = 0;
			for (int i = 0; i < j; i++)
			{
				byte b = md[i];
				str[k++] = hexDigits[b >> 4 & 0xf];
				str[k++] = hexDigits[b & 0xf];
			}

		}
		catch (NoSuchAlgorithmException e)
		{
			return null;
		}
		return new String(str);
	}

	public static void main(String args[])
	{
		System.out.println(getPwd("123456"));
	}
}
